Design Matrix
   HOME

TheInfoList



OR:

In
statistics Statistics (from German: '' Statistik'', "description of a state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, indust ...
and in particular in
regression analysis In statistical modeling, regression analysis is a set of statistical processes for estimating the relationships between a dependent variable (often called the 'outcome' or 'response' variable, or a 'label' in machine learning parlance) and one ...
, a design matrix, also known as model matrix or regressor matrix and often denoted by X, is a
matrix Matrix most commonly refers to: * ''The Matrix'' (franchise), an American media franchise ** '' The Matrix'', a 1999 science-fiction action film ** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchi ...
of values of
explanatory variable Dependent and independent variables are variables in mathematical modeling, statistical modeling and experimental sciences. Dependent variables receive this name because, in an experiment, their values are studied under the supposition or deman ...
s of a set of objects. Each row represents an individual object, with the successive columns corresponding to the variables and their specific values for that object. The design matrix is used in certain
statistical model A statistical model is a mathematical model that embodies a set of statistical assumptions concerning the generation of sample data (and similar data from a larger population). A statistical model represents, often in considerably idealized form ...
s, e.g., the
general linear model The general linear model or general multivariate regression model is a compact way of simultaneously writing several multiple linear regression models. In that sense it is not a separate statistical linear model. The various multiple linear regr ...
. It can contain indicator variables (ones and zeros) that indicate group membership in an ANOVA, or it can contain values of
continuous variable In mathematics and statistics, a quantitative variable may be continuous or discrete if they are typically obtained by ''measuring'' or '' counting'', respectively. If it can take on two particular real values such that it can also take on all ...
s. The design matrix contains data on the
independent variable Dependent and independent variables are variables in mathematical modeling, statistical modeling and experimental sciences. Dependent variables receive this name because, in an experiment, their values are studied under the supposition or dema ...
s (also called explanatory variables) in statistical models which attempt to explain observed data on a response variable (often called a
dependent variable Dependent and independent variables are variables in mathematical modeling, statistical modeling and experimental sciences. Dependent variables receive this name because, in an experiment, their values are studied under the supposition or dema ...
) in terms of the explanatory variables. The theory relating to such models makes substantial use of matrix manipulations involving the design matrix: see for example
linear regression In statistics, linear regression is a linear approach for modelling the relationship between a scalar response and one or more explanatory variables (also known as dependent and independent variables). The case of one explanatory variable is cal ...
. A notable feature of the concept of a design matrix is that it is able to represent a number of different
experimental design The design of experiments (DOE, DOX, or experimental design) is the design of any task that aims to describe and explain the variation of information under conditions that are hypothesized to reflect the variation. The term is generally associ ...
s and statistical models, e.g., ANOVA,
ANCOVA Analysis of covariance (ANCOVA) is a general linear model which blends ANOVA and regression. ANCOVA evaluates whether the means of a dependent variable (DV) are equal across levels of a categorical independent variable (IV) often called a treatm ...
, and linear regression.


Definition

The design matrix is defined to be a matrix X such that X_ (the ''j''th column of the ''i''th row of X) represents the value of the ''j''th variable associated with the ''i''th object. A regression model may be represented via matrix multiplication as :y=X\beta+e, where ''X'' is the design matrix, \beta is a vector of the model's coefficients (one for each variable), e is a vector of random errors with mean zero, and ''y'' is the vector of predicted outputs for each object.


Size

The
matrix Matrix most commonly refers to: * ''The Matrix'' (franchise), an American media franchise ** '' The Matrix'', a 1999 science-fiction action film ** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchi ...
of
data In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpret ...
has dimension ''n''-by-''p'', where ''n'' is the number of samples observed, and ''p'' is the number of variables (
features Feature may refer to: Computing * Feature (CAD), could be a hole, pocket, or notch * Feature (computer vision), could be an edge, corner or blob * Feature (software design) is an intentional distinguishing characteristic of a software ite ...
) measured in all samples. In this representation different rows typically represent different repetitions of an experiment, while columns represent different types of data (say, the results from particular probes). For example, suppose an experiment is run where 10 people are pulled off the street and asked four questions. The data matrix ''M'' would be a 10×4 matrix (meaning 10 rows and 4 columns). The datum in row ''i'' and column ''j'' of this matrix would be the answer of the ''i'' th person to the ''j'' th question.


Examples


Arithmetic mean

The design matrix for an
arithmetic mean In mathematics and statistics, the arithmetic mean ( ) or arithmetic average, or just the '' mean'' or the ''average'' (when the context is clear), is the sum of a collection of numbers divided by the count of numbers in the collection. The co ...
is a
column A column or pillar in architecture and structural engineering is a structural element that transmits, through compression (physical), compression, the weight of the structure above to other structural elements below. In other words, a column i ...
vector of ones In mathematics, a matrix of ones or all-ones matrix is a matrix where every entry is equal to one. Examples of standard notation are given below: :J_2 = \begin 1 & 1 \\ 1 & 1 \end;\quad J_3 = \begin 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end;\quad ...
.


Simple linear regression

This section gives an example of
simple linear regression In statistics, simple linear regression is a linear regression model with a single explanatory variable. That is, it concerns two-dimensional sample points with one independent variable and one dependent variable (conventionally, the ''x'' and ...
—that is, regression with only a single explanatory variable—with seven observations. The seven data points are , for ''i'' = 1, 2, …, 7. The simple linear regression model is : y_i = \beta_0 + \beta_1 x_i +\varepsilon_i, \, where \beta_0 is the ''y''-intercept and \beta_1 is the slope of the regression line. This model can be represented in matrix form as : \beginy_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end = \begin1 & x_1 \\1 & x_2 \\1 & x_3 \\1 & x_4 \\1 & x_5 \\1 & x_6 \\ 1 & x_7 \end \begin \beta_0 \\ \beta_1 \end + \begin \varepsilon_1 \\ \varepsilon_2 \\ \varepsilon_3 \\ \varepsilon_4 \\ \varepsilon_5 \\ \varepsilon_6 \\ \varepsilon_7 \end where the first column of 1s in the design matrix allows estimation of the ''y''-intercept while the second column contains the ''x''-values associated with the corresponding ''y''-values.


Multiple regression

This section contains an example of multiple regression with two covariates (explanatory variables): ''w'' and ''x''. Again suppose that the data consist of seven observations, and that for each observed value to be predicted (y_i), values ''w''''i'' and ''x''''i'' of the two covariates are also observed. The model to be considered is : y_i = \beta_0 + \beta_1 w_i + \beta_2 x_i + \varepsilon_i This model can be written in matrix terms as : \beginy_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end = \begin 1 & w_1 & x_1 \\1 & w_2 & x_2 \\1 & w_3 & x_3 \\1 & w_4 & x_4 \\1 & w_5 & x_5 \\1 & w_6 & x_6 \\ 1& w_7 & x_7 \end \begin \beta_0 \\ \beta_1 \\ \beta_2 \end + \begin \varepsilon_1 \\ \varepsilon_2 \\ \varepsilon_3 \\ \varepsilon_4 \\ \varepsilon_5 \\ \varepsilon_6 \\ \varepsilon_7 \end Here the 7×3 matrix on the right side is the design matrix.


One-way ANOVA (cell means model)

This section contains an example with a one-way analysis of variance ( ANOVA) with three groups and seven observations. The given data set has the first three observations belonging to the first group, the following two observations belonging to the second group and the final two observations belonging to the third group. If the model to be fit is just the mean of each group, then the model is : y_ = \mu_i + \varepsilon_ which can be written : \beginy_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end = \begin1 & 0 & 0 \\1 &0 &0 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 1\end \begin\mu_1 \\ \mu_2 \\ \mu_3 \end + \begin \varepsilon_1 \\ \varepsilon_2 \\ \varepsilon_3 \\ \varepsilon_4 \\ \varepsilon_5 \\ \varepsilon_6 \\ \varepsilon_7 \end In this model \mu_i represents the mean of the ith group.


One-way ANOVA (offset from reference group)

The ANOVA model could be equivalently written as each group parameter \tau_i being an offset from some overall reference. Typically this reference point is taken to be one of the groups under consideration. This makes sense in the context of comparing multiple treatment groups to a control group and the control group is considered the "reference". In this example, group 1 was chosen to be the reference group. As such the model to be fit is : y_ = \mu + \tau_i + \varepsilon_ with the constraint that \tau_1 is zero. : \beginy_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end = \begin1 &0 &0 \\1 &0 &0 \\ 1 & 0 & 0 \\ 1 & 1 & 0 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \\ 1 & 0 & 1\end \begin\mu \\ \tau_2 \\ \tau_3 \end + \begin \varepsilon_1 \\ \varepsilon_2 \\ \varepsilon_3 \\ \varepsilon_4 \\ \varepsilon_5 \\ \varepsilon_6 \\ \varepsilon_7 \end In this model \mu is the mean of the reference group and \tau_i is the difference from group i to the reference group. \tau_1 is not included in the matrix because its difference from the reference group (itself) is necessarily zero.


See also

* Moment matrix * Projection matrix *
Jacobian matrix and determinant In vector calculus, the Jacobian matrix (, ) of a vector-valued function of several variables is the matrix of all its first-order partial derivatives. When this matrix is square, that is, when the function takes the same number of variable ...
*
Scatter matrix : ''For the notion in quantum mechanics, see scattering matrix.'' In multivariate statistics and probability theory, the scatter matrix is a statistic that is used to make estimates of the covariance matrix, for instance of the multivariate norm ...
* Gram matrix * Vandermonde matrix


References


Further reading

* {{Matrix classes Matrices Regression analysis Design of experiments Multivariate statistics Data